package com.just.recruitback.controller;


import com.just.recruitback.entity.User;
import com.just.recruitback.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baibaiwuchang
 * @since 2020-07-04
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @PostMapping("/login")
    public int login(@RequestBody User user) {
        return userService.login(user);
    }

    @PostMapping("/register")
    public int register(@RequestBody User user) {
        return userService.register(user);
    }

    @PostMapping("/edit")
    public void editUser(@RequestBody User user) {
        userService.edit(user);
    }
}
